50 minutos atrás, Poccnn disse:Vamos recapitular, pois é difícil entender o que tu quer dizer.
Então a função sleep serve apenas para paralisar o monstro?
Possivelmente a remoção do monstro está sendo executada antes desse script, por isso gera o erro de não ter encontrado a criatura.
O que eu não estou entendendo e o do porque que esse erro está sendo chamado por spell.
Essa spell está associada ao monstro ou ao player?
Se for ao monstro, e não existindo mais o monstro, logo chegamos a conclusão de que é um evento inerente ao monstro que não o encontrou mais.
Posta o script dessa spell.
primeiramente sim, essa função paralisa o monstro, ele fica incapaz de se mover ou conjurar spells é um tipo de (stop) pois o paralise permite spell e movimento embora lento e o sleep impede tanto o movimento quanto spell
o erro esta associado não a uma mas sim a varias spells, as spells equivale a paralize rune são elas que colocam o status sleep nos monstros
postarei 2 das spells abaixo
Spell 1
elseif spell == "Yawn" then
local ret = {}
ret.id = target
ret.cd = math.random(6, 9)
ret.check = getPlayerStorageValue(target, conds["Sleep"])
ret.first = true
ret.cond = "Sleep"
doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 11)
addEvent(doMoveDano2, 1500, cid, target, NORMALDAMAGE, 0, 0, ret, spell)
spell2
elseif spell == "Hypnosis" then
local ret = {}
ret.id = target
ret.cd = math.random(6, 9)
ret.check = getPlayerStorageValue(target, conds["Sleep"])
ret.first = true
ret.cond = "Sleep"
doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 24)
addEvent(doMoveDano2, 150, cid, target, PSYCHICDAMAGE, 0, 0, ret, spell)
e como o doMoveDano2 é citado apesar de n ter erro relacionado vou posta-lo abaixo
doMoveDano2
function doMoveDano2(cid, pid, element, min, max, ret, spell)
if isCreature(pid) and isCreature(cid) and cid ~= pid then
if isNpcSummon(pid) and getCreatureTarget(pid) ~= cid then
return true --alterado v1.6
end
if ehNPC(pid) then return true end
---
local canAtk = true --alterado v1.6
if getPlayerStorageValue(pid, 21099) >= 1 then
doSendMagicEffect(getThingPosWithDebug(pid), 135)
doSendAnimatedText(getThingPosWithDebug(pid), "REFLECT", COLOR_GRASS)
addEvent(docastspell, 100, pid, spell)
if getCreatureName(pid) == "Wobbuffet" or getCreatureName(pid) == "Reflector Wobbuffet" or getCreatureName(pid) == "Wowofet" then
doRemoveCondition(pid, CONDITION_OUTFIT)
end
canAtk = false
setPlayerStorageValue(pid, 21099, -1)
setPlayerStorageValue(pid, 21100, 1)
setPlayerStorageValue(pid, 21101, cid)
setPlayerStorageValue(pid, 21103, getTableMove(cid, getPlayerStorageValue(cid, 21102)).f)
end
---
if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
if isSummon(cid) and (ehMonstro(pid) or (isSummon(pid) and canAttackOther(cid, pid) == "Can") or (isPlayer(pid) and canAttackOther(cid, pid) == "Can" and #getCreatureSummons(pid) <= 0)) and pid ~= cid then
if canAtk then --alterado v1.6
if ret and ret.cond then
ret.id = pid
ret.check = getPlayerStorageValue(pid, conds[ret.cond])
doCondition2(ret)
end
if spell == "Selfdestruct" then
if getPlayerStorageValue(pid, 9658783) <= 0 then
doSendAnimatedText(getThingPosWithDebug(pid), "-"..max.."", COLOR_NORMAL)
doCreatureAddHealth(pid, -max) --alterado v1.6
end
else
doTargetCombatHealth(cid, pid, element, -(math.abs(min / 2)), -(math.abs(max / 2)), 255)
end
end
elseif ehMonstro(cid) and (isSummon(pid) or (isPlayer(pid) and #getCreatureSummons(pid) <= 0)) and pid ~= cid then
if canAtk then --alterado v1.6
if ret and ret.cond then
ret.id = pid
ret.check = getPlayerStorageValue(pid, conds[ret.cond])
doCondition2(ret)
end
if spell == "Selfdestruct" then
if getPlayerStorageValue(pid, 9658783) <= 0 then
doSendAnimatedText(getThingPosWithDebug(pid), "-"..max.."", COLOR_NORMAL)
doCreatureAddHealth(pid, -max) --alterado v1.6
end
else
doTargetCombatHealth(cid, pid, element, -(math.abs(min / 2)), -(math.abs(max / 2)), 255)
end
end
elseif isPlayer(cid) and ehMonstro(pid) and pid ~= cid then
if canAtk then --alterado v1.6
if ret and ret.cond then
ret.id = pid
ret.check = getPlayerStorageValue(pid, conds[ret.cond])
doCondition2(ret)
end
if spell == "Selfdestruct" then
if getPlayerStorageValue(pid, 9658783) <= 0 then
doSendAnimatedText(getThingPosWithDebug(pid), "-"..max.."", COLOR_NORMAL)
doCreatureAddHealth(pid, -max) --alterado v1.6
end
else
doTargetCombatHealth(cid, pid, element, -(math.abs(min / 2)), -(math.abs(max / 2)), 255)
end
end
end
end
end





info
Grupo: Herói
Registrado: 07/03/16
Posts: 1.4k
Reputação: +385
Gênero: Masculino
Vamos recapitular, pois é difícil entender o que tu quer dizer.
Então a função sleep serve apenas para paralisar o monstro?
Possivelmente a remoção do monstro está sendo executada antes desse script, por isso gera o erro de não ter encontrado a criatura.
O que eu não estou entendendo e o do porque que esse erro está sendo chamado por spell.
Essa spell está associada ao monstro ou ao player?
Se for ao monstro, e não existindo mais o monstro, logo chegamos a conclusão de que é um evento inerente ao monstro que não o encontrou mais.
Posta o script dessa spell.